/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ticketmaster.dataobject;

import java.sql.Timestamp;
import ticketmaster.util.DateTimeHelper;

/**
 *
 * @author Wei Liu
 */
public class EventView
{

    private int eventID;
    private int venueID;
    private String type;
    private String eventName;
    private String price;
    private String description;
    private Timestamp beginDateTime;
    private Timestamp endDateTime;
    private String keywords;
    private boolean cancelled;
    private String venueName;
    private String location;

    /**
     * @return the eventID
     */
    public int getEventID()
    {
        return eventID;
    }

    /**
     * @param eventID the eventID to set
     */
    public void setEventID(int eventID)
    {
        this.eventID = eventID;
    }

    /**
     * @return the venueID
     */
    public int getVenueID()
    {
        return venueID;
    }

    /**
     * @param venueID the venueID to set
     */
    public void setVenueID(int venueID)
    {
        this.venueID = venueID;
    }

    /**
     * @return the eventName
     */
    public String getName()
    {
        return eventName;
    }

    /**
     * @param eventName the eventName to set
     */
    public void setName(String name)
    {
        this.eventName = name;
    }

    /**
     * @return the description
     */
    public String getDescription()
    {
        return description;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description)
    {
        this.description = description;
    }

    /**
     * @return the date
     */
    public Timestamp getBeginDateTime()
    {
        return beginDateTime;
    }

    /**
     * @param date the date to set
     */
    public void setBeginDateTime(Timestamp beginDateTime)
    {
        this.beginDateTime = beginDateTime;
    }

    /**
     * @return the time
     */
    public Timestamp getEndDateTime()
    {
        return endDateTime;
    }

    /**
     * @param time the time to set
     */
    public void setEndDateTime(Timestamp endDateTime)
    {
        this.endDateTime = endDateTime;
    }

    /**
     * @return the cancelled
     */
    public boolean isCancelled()
    {
        return cancelled;
    }

    /**
     * @param cancelled the cancelled to set
     */
    public void setCancelled(boolean cancelled)
    {
        this.cancelled = cancelled;
    }

    /**
     * @return the type
     */
    public String getType()
    {
        return type;
    }

    /**
     * @param type the type to set
     */
    public void setType(String type)
    {
        this.type = type;
    }

    /**
     * @return the price
     */
    public String getPrice()
    {
        return price;
    }

    /**
     * @param price the price to set
     */
    public void setPrice(String price)
    {
        this.price = price;
    }

    /**
     * @return the keywords
     */
    public String getKeywords()
    {
        return keywords;
    }

    /**
     * @param keywords the keywords to set
     */
    public void setKeywords(String keywords)
    {
        this.keywords = keywords;
    }

    /**
     * @return the venueName
     */
    public String getVenueName()
    {
        return venueName;
    }

    /**
     * @param venueName the venueName to set
     */
    public void setVenueName(String venueName)
    {
        this.venueName = venueName;
    }

    /**
     * @return the location
     */
    public String getLocation()
    {
        return location;
    }

    /**
     * @param location the location to set
     */
    public void setLocation(String location)
    {
        this.location = location;
    }

    @Override
    public String toString()
    {
        return DateTimeHelper.formatDate(this.beginDateTime) + "\n" + DateTimeHelper.formatTime(this.beginDateTime) + " to " + DateTimeHelper.formatTime(this.endDateTime);
    }

    public String getDisplayPrice()
    {
        String displayPrice = price;
        displayPrice = displayPrice.replaceAll("B", "\nB");
        displayPrice = displayPrice.replaceAll("C", "\nC");
        displayPrice = displayPrice.replaceAll("D", "\nD");
        displayPrice = displayPrice.replaceAll("E", "\nE");
        return displayPrice;
    }

    public String getDisplayEventName()
    {
        if(description.isEmpty())
            return eventName.replaceAll(" - Group", "\nGroup").replaceAll(" - Game", "\nGame");
        else
            return eventName.replaceAll(" - Group", "\nGroup").replaceAll(" - Game", "\nGame") + "\n" + description;
    }
}
